<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
require 'dbcon.php';
$sql="select * from categories";
$result=$db->query($sql);
$num=$result->num_rows;//不分页的总的记录数
//这个总的记录数可以给我们计算  总页数=ceil(总的记录数/pagesize)
$post=$result->fetch_all(MYSQLI_ASSOC);//产生的这个数组是二维关联数组，下标是字符串
$result->free_result();
$db->close();//关闭数据库连接
require "post-add.php";